﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZedGraph;

namespace FaceRecognition
{
    public partial class frmHistogram : Form
    {
        private double[] arr;

        public frmHistogram(double[] histogram)
        {
            InitializeComponent();
            arr = histogram;
            CreateGraph(zedGraphControl1);
        }

        private void CreateGraph(ZedGraphControl zgc)
        {
            GraphPane myPane = zgc.GraphPane;
            myPane.Title.Text = "Histogram";
            myPane.XAxis.Title.Text = "Bin";
            myPane.YAxis.Title.Text = "Count";
            string[] labels = Array.ConvertAll(arr, x => x.ToString());
            BarItem bar = myPane.AddBar("", null, arr, Color.Blue);
            zgc.AxisChange();
        }
    }
}
